<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
{#todo #}
{% if user %}
    欢迎 {{ user }}
{% else %}
    <a href="{% url 'loginx' %}">请登录</a>
{% endif %}

<br>

<a href="{% url 'logoutx' %}">注销</a>

<a href="{% url 'add_article' %}">添加</a>
<br>
<form action="">
    <input type="text" name="seacher" placeholder="请输入要搜寻的内容">

    <input type="submit" value="搜索">

</form>
<a href="?type=0">原创</a>
<br>
<a href="?type=1">转载</a>
<br>
<a href="?type=2">翻译</a>
<br>
<a href="{% url 'index' %}?orderbytitle=0">title正向</a>
<br>
<a href="{% url 'index' %}?orderbytitle=1">title反向</a>
<br>
&nbsp;&nbsp;&nbsp;<a href="{% url 'index' %}?orderby_update_time=0">修改时间正向</a>
<br>
&nbsp;&nbsp;&nbsp;<a href="{% url 'index' %}?orderby_update_time=1">修改时间反向</a>
<br>
{% for article in pagex.object_list %}
    <a href="{% url 'article_detail' %}?id={{ article.id }}">{{ article.title }}</a>&nbsp;&nbsp;
    {{ article.update_time|date:"Y/m/d H:i:s" }}
    <br>
{% endfor %}
{% if pagex.number > 1 %}
    <a href="{% url 'index' %}?page={{ pagex.number|add:-1 }}">上一页</a>
{% endif %}

&nbsp;&nbsp;<b>当前页{{ pagex.number }}

    {% if hasnext %}
        </b> &nbsp;&nbsp;<a href="{% url 'index' %}?page={{ pagex.number|add:1 }}">下一页</a>
    {% endif %}

</body>
</html>